package org.feign.client.fallback;

import org.feign.client.UserFeignClient;
import org.feign.pojo.User;
import org.springframework.stereotype.Component;

@Component //降级方法一定要加@Component
public class UserFeignFallback implements UserFeignClient {
    //降级方法
    @Override
    public User findByUsername(String username) {
        User user = new User();
        user.setName("对不起，网络出现异常，这是feign的服务降级方法");
        return user;
    }
}
